<template>
  <div class="class-table">
    <!-- <div class="table-wrapper">
			<div class="tabel-container">
			</div>
		</div> -->
    <a-table
      :columns="columns"
      :data-source="dataSource"
      bordered
      size="middle"
      :scroll="{ x: 'calc(700px + 80%)', y: 240 }"
    />
	<verticalTable :dataSource="dataSource"/>
    <div class="btn">
      <a-button type="primary">保存</a-button>
      <a-button type="primary" class="addaAuxiliary">取消</a-button>
    </div>
  </div>
</template>

<script>
import { getNewStyleBomDet } from "@api/spection/index";
import { auxMaterialColumn } from "./columnsConfig";
import verticalTable from './verticalTable'
export default {
  name: "amin",
  data() {
    return {
      columns: auxMaterialColumn,
      dataSource: [],
    };
  },
  components: {
	verticalTable
  },
  mounted() {
    this.getNewStyleBomDet();
  },
  methods: {
    /**
     * 数字转中文
     * @param {Number} num 需要转换的数字
     * @param {String} identifier 标识符
     * @returns {String} 转换后的中文
     */
    digital2Chinese(num, identifier) {
      const character = [
        "零",
        "一",
        "二",
        "三",
        "四",
        "五",
        "六",
        "七",
        "八",
        "九",
        "十",
        "十一",
        "十二",
      ];
      return identifier === "week" && (num === 0 || num === 7) ? "日" : character[num];
    },
    async getNewStyleBomDet() {
      const res = await getNewStyleBomDet(this.$route.query.billNo).then((res) => {
        if (res.code == 200) {
          this.dataSource = res.data;
		  window.console.log('dataSource', this.dataSource)
        } else {
          if (res.msg) {
            this.$message.error(res.msg);
          } else {
            this.$message.error("获取待办列表失败！");
          }
        }
      });
    },
  },
};
</script>

<style lang="less" scoped>
.class-table {
  .table-wrapper {
    width: 100%;
    height: 100%;
    overflow: auto;
  }

  .tabel-container {
    margin: 7px;

    table {
      table-layout: fixed;
      width: 100%;

      thead {
        background-color: #67a1ff;

        th {
          color: #fff;
          line-height: 17px;
          font-weight: normal;
        }
      }

      tbody {
        background-color: #eaf2ff;

        td {
          color: #677998;
          line-height: 12px;
        }
      }

      th,
      td {
        width: 60px;
        padding: 12px 2px;
        font-size: 12px;
        text-align: center;
        border: 1px solid grey;
      }

      tr td:first-child {
        color: #333;

        .period {
          font-size: 8px;
        }
      }
    }
  }
}

.btn {
  margin: 30px 0 0 60px;

  .addaAuxiliary {
    margin: 0 20px;
  }
}
</style>
